import {
  ActivityDefinitionProperty,
  WorkflowPersistenceBehavior,
  Connection,
  ActivityDescriptor,
  WorkflowInstance,
} from "./domain";
import { Map } from "./utils";
export interface WorkflowModel {
  activities: Array<ActivityModel>;
  connections: Array<ConnectionModel>;
  persistenceBehavior?: WorkflowPersistenceBehavior;
  activityDescriptors: Array<ActivityDescriptor>;
  workflowInstance: WorkflowInstance;
  activityDisplayContexts: Map<ActivityDesignDisplayContext>;
}

export interface ActivityModel {
  activityId: string;
  type?: string;
  name?: string;
  displayName?: string;
  description?: string;
  outcomes?: Array<string>;
  properties?: Array<ActivityDefinitionProperty>;
  persistWorkflow?: boolean;
  loadWorkflowContext?: boolean;
  saveWorkflowContext?: boolean;
  propertyStorageProviders?: Map<string>;
  x?: number;
  y?: number;
  state?: any;
}

export interface ConnectionModel {
  sourceId: string;
  targetId: string;
  outcome?: string;
  targetPort?: string;
}

export interface ActivityDesignDisplayContext {
  activityModel: ActivityModel;
  activityDescriptor: ActivityDescriptor;
  activityIcon?: any;
  displayName?: string;
  bodyDisplay?: string;
  outcomes: Array<string>;
  expanded?: boolean;
}
